Cayenne User Documentation
Remote Object Persistence CWS Deployment

CWS Deployment with Hessian

Hessian-based Cayenne Web Service is a regular Java web application that contains Cayenne mapping file and persistent objects. What makes it a web service is a HessianServlet mapped via web.xml that handles requests from Cayenne Client Tier applications.

Client tier Java classes have to be present on the server together with server DataObjects. So you'll end up with two sets of objects mapped to the same set of entities. Hopefully we will get rid of this inconvenience in the future releases.

A typical CWS application .war file:

myapp/
  WEB-INF/
     web.xml
     lib/
        cayenne.jar
        hessian.jar
        my-db-driver.jar
        someother.jar
     classes/
        cayenne.xml
        DataMap.map.xml
        DataNode.driver.xml

        com/mycompany/PersistentObject1.class
        com/mycompany/auto/_PersistentObject1.class

        com/mycompany/client/PersistentObject1.class
        com/mycompany/client/auto/_PersistentObject1.class

Configuring Deployment Parameters in web.xml

Cayenne service configuration is done via web.xml:

.